#include <iostream>
using namespace std;

class MyBuffer
{
private:
    int* myNums;

public:
    //重载构造函数
    MyBuffer(unsigned int length)
    {
        cout << "Constructor allocates " << length << " integers" << endl;
        myNums = new int[length]; //分配内存
    }

    //析构函数
    ~MyBuffer()
    {
        cout << "Destructor releasing allocated memory" << endl;
        delete[] myNums; // 释放分配的内存
    }

    // other set and get functions to work with myNums
};

int main()
{
    cout << "How many integers would you like to store? ";
    unsigned int numsToStore = 0;
    cin >> numsToStore;

    MyBuffer buf(numsToStore);

    return 0;
}